# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-extras
_pkgname=extras
pkgver=1.0.0
pkgrel=10
pkgdesc="Useful extra bits for Python - things that shold be in the standard library"
url="https://pypi.org/project/extras/"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-testtools"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver
replaces="py-extras" # Backwards Compatibility
provides="py-extras=$pkgver-r$pkgrel" # Backwards Compatibility
options="!check" # py3-testtools depends on this

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
510c796628f28db90bb96c7c9ba5fc9b2b950d2968e219efe67f3899bbe7ef68fe5de1494f8fd640f13a1ccd329e7dac9cd38aa965ab1e07c4cd287c04da50fb  extras-1.0.0.tar.gz
"
